
package com.wwy.monitor.service;

import com.wwy.monitor.model.tddl.dto.MonitorIpDTO;
import com.wwy.monitor.model.tddl.query.MonitorIpQuery;
import com.wwy.monitor.model.tddl.vo.MonitorIpVO;
import com.wwy.monitor.model.vo.ServerInfo;

import java.util.List;
import java.util.Map;

/**
 * @author tianquan.ld
 * @version V1.0
 * <p>Description: çæ§ip service</p>
 * @date 2019-10-30 21:17
 */
public interface MonitorIpService {
    /**
     * æ°å»º
     *
     * @param entity
     * @return
     */
    boolean insert(MonitorIpDTO entity);

    /**
     * æ¹éåå»º
     *
     * @param list
     * @return
     */
    boolean insertBatch(List<MonitorIpDTO> list);

    /**
     * æ¹éé»è¾å é¤
     */
    boolean deleteByIds(String ids);

    /**
     * å é¤
     *
     * @param id
     * @return
     */
    boolean deleteById(Long id);

    /**
     * æ ¹æ®appIdé»è¾å é¤ip
     *
     * @param appId åºç¨id
     * @return å é¤æ¡æ°
     */
    int deleteByAppId(Long appId);

    /**
     * æ´æ°
     *
     * @param entity
     * @return
     */
    boolean updateById(MonitorIpDTO entity);

    /**
     * æ ¹æ®åºç¨idä¸çº¿æºå¨
     *
     * @param appId åºç¨id
     * @return ä¸çº¿æºå¨æ¡æ°
     */
    int offlineIpByAppId(Long appId);

    /**
     * æ ¹æ®åºç¨idè·åææipåè¡¨
     *
     * @param appId åºç¨id
     * @return ipåè¡¨
     */
    List<MonitorIpDTO> getAllIpByAppId(Long appId, String ip);

    /**
     * æ ¹æ®æºå¨ipIdè¿è¡¨æ¥è¯¢appç¶æ
     *
     * @param id ipId
     * @return appç¶æ
     */
    Integer selectAppStatusByIpId(Long id);

    /**
     * æ¥è¯¢
     *
     * @param query
     * @return
     */
    List<MonitorIpDTO> selectByQuery(MonitorIpQuery query);

    /**
     * è¿è¡¨æ¥è¯¢
     *
     * @return
     */
    List<MonitorIpVO> queryMonitorIp(MonitorIpQuery query);

    /**
     * æ ¹æ®idæ¥è¯¢
     *
     * @param id
     * @return
     */
    MonitorIpDTO selectById(Long id);

    /**
     * å¨é¨æ°é
     *
     * @return
     */
    Integer count(MonitorIpQuery query);

    List<ServerInfo> getServerIps(String appName);

    /**
     * åæ­¥åºç¨ip
     *
     * @param appName
     * @return
     */
    boolean syncServerIp(String appName);
}